package com.etc.springbootssm.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {

    /**
     * 全局方法的500异常
     * @return
     */
    @ExceptionHandler(ArithmeticException.class)
    @ResponseBody
    public String exhandler(){
        return "全局存在数学运算异常";
    }

}
